home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / text / StyledEditorKit$BoldAction.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.1 KB  |  24 lines

  1. package javax.swing.text;
  2.  
  3. import java.awt.event.ActionEvent;
  4. import javax.swing.JEditorPane;
  5.  
  6. public class StyledEditorKit$BoldAction extends StyledEditorKit.StyledTextAction {
  7.    public StyledEditorKit$BoldAction() {
  8.       super("font-bold");
  9.    }
  10.  
  11.    public void actionPerformed(ActionEvent var1) {
  12.       JEditorPane var2 = ((StyledEditorKit.StyledTextAction)this).getEditor(var1);
  13.       if (var2 != null) {
  14.          StyledEditorKit var3 = ((StyledEditorKit.StyledTextAction)this).getStyledEditorKit(var2);
  15.          MutableAttributeSet var4 = var3.getInputAttributes();
  16.          boolean var5 = !StyleConstants.isBold(var4);
  17.          SimpleAttributeSet var6 = new SimpleAttributeSet();
  18.          StyleConstants.setBold(var6, var5);
  19.          ((StyledEditorKit.StyledTextAction)this).setCharacterAttributes(var2, var6, false);
  20.       }
  21.  
  22.    }
  23. }
  24.